/**
* @description: 危险点分析
* @author: wqn & yanxiaoyue
* @data:2023年6月29日 - 2023年7月14日
* @remark:
**/

<template>
	<view class="danger">
		<nav-bar title="危险点分析-查看" @goBack="goBack"></nav-bar>
		<view class="main">
			<view class="title">
				<text>危险点分析及预控措施</text>
			</view>
			<view class="content-list" v-for="(item,index) in dangerData" :key="index">
				<view class="border">
					<view class="sub-title">
						<span>{{ index + 1 }}</span>
						<text>{{ item.hazardPointAnalysis }}</text>
					</view>
					<van-divider></van-divider>
					<view class="sub-content">
						<text>预控措施：</text>
						<br>
						<text>{{ item.controlMeasure }}</text>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import NavBar from "../../../standardizedOperation/common/navBar.vue";
	import {
		selectwxdmeasureslog
	} from "../../../../api/bzhzyApi";

	export default {
		name: "dangerDetails",
		components: {
			NavBar
		},
		data() {
			return {
				dangerData: []
			}
		},
		onLoad(option) {
			this.work = JSON.parse(option.pushParam)
			this.getWxdmeasureslog()
		},
		methods: {
			goBack() {
				uni.navigateBack()
			},
			getWxdmeasureslog() {
				this.$apiRequest.bzhzyApi.selectwxdmeasureslog({
					workPlanId: this.work.id,
					consultationDeductionId: this.work.OBJID,
					pageFlag: this.work.pageFlag
				}).then(res => {
					this.dangerData = res.data
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.danger {
		display: flex;
		flex-direction: column;
		width: 100vw;
		height: 100vh;
		background: #F2F6FA;
		overflow: hidden;

		.main {
			flex: 1;
			overflow: scroll;
			margin: px2vh(50) px2vw(30);

			text {
				font-size: px2vh(40);
				font-weight: bold;
				color: #666666;
			}

			.title {
				margin-bottom: px2vh(30);
				display: flex;
				align-items: center;

				text:nth-child(1) {
					flex: 1
				}

				img {
					margin-right: px2vw(16);
				}
			}

			.content-list {
				padding: px2vw(20) 0;
				background: #FFFFFF;
				border-radius: px2vh(20);
				margin-bottom: px2vh(30);

				.border {
					margin: px2vh(50);

					.sub-title {
						background: #FFFFFF;
						display: flex;
						align-items: center;

						.active {
							color: #007AFF;
						}

						span {
							display: block;
							width: px2vw(60);
							height: px2vw(60);
							line-height: px2vw(60);
							font-size:px2vh(38) ;
							background: #417ADC;
							border-radius: 100%;
							color: #FFFFFF;
							font-weight: bold;
							text-align: center;
							margin-right: px2vw(22);
						}

						text {
							flex: 1;
							font-size: px2vh(42);
						}

					}

					.sub-content {
						text {
							font-size: px2vh(38);
							font-weight: normal;
							line-height: px2vh(62);
						}
					}
				}

			}
		}
	}

	.img-icon {
		width: 13px;
		height: 13px;
	}
</style>
